$OpenBSD: patch-spooler_Spooler_cpp,v 1.22 2016/09/04 14:52:38 robert Exp $
--- spooler/Spooler.cpp.orig	Wed Apr 20 13:13:54 2016
+++ spooler/Spooler.cpp	Wed Apr 20 19:54:13 2016
@@ -1151,10 +1151,10 @@ int main(int argc, char *argv[]) {
 		{ "smtp_port","25", CONFIGSETTING_RELOADABLE },
 		{ "server_socket", "default:" },
 #ifdef LINUX
-		{ "run_as_user", "zarafa" },
-		{ "run_as_group", "zarafa" },
+		{ "run_as_user", "_zarafa" },
+		{ "run_as_group", "_zarafa" },
 		{ "pid_file", "/var/run/zarafad/spooler.pid" },
-		{ "running_path", "/var/lib/zarafa" },
+		{ "running_path", "${LOCALSTATEDIR}/empty" },
 		{ "coredump_enabled", "no" },
 #endif
 		{ "log_method","file" },
@@ -1179,8 +1179,8 @@ int main(int argc, char *argv[]) {
 		{ "archive_on_send", "no", CONFIGSETTING_RELOADABLE },
 		{ "enable_dsn", "yes", CONFIGSETTING_RELOADABLE },
         { "plugin_enabled", "yes" },
-        { "plugin_path", "/var/lib/zarafa/spooler/plugins" },
-        { "plugin_manager_path", "/usr/share/zarafa-spooler/python" },
+        { "plugin_path", "${LOCALSTATEDIR}/db/zarafa/spooler/plugins" },
+        { "plugin_manager_path", "${PREFIX}/share/zarafa-spooler/python" },
 		{ "z_statsd_stats", "/var/run/zarafad/statsd.sock" },
 		{ "tmp_path", "/tmp" },
 		{ "tmp_path", "/tmp" },
@@ -1311,6 +1311,7 @@ int main(int argc, char *argv[]) {
 #ifdef LINUX
 	// detect linuxthreads, which is too broken to correctly run the spooler
 	if (!bForked) {
+#if defined(__linux__)
 		char buffer[256] = { 0 };
 		confstr(_CS_GNU_LIBPTHREAD_VERSION, buffer, sizeof(buffer));
 
@@ -1320,6 +1321,10 @@ int main(int argc, char *argv[]) {
 			g_lpLogger->Log(EC_LOGLEVEL_WARNING, "WARNING: your system is running with outdated linuxthreads.");
 			g_lpLogger->Log(EC_LOGLEVEL_WARNING, "WARNING: the zarafa-spooler will only be able to send one message at a time.");
 		}
+#elif defined(__OpenBSD__)
+		bNPTL = false;
+		g_lpConfig->AddSetting("max_threads","1");
+#endif
 	}
 #endif
 
